import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-app/gamecoupon/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/blade-app/gamecoupon/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/blade-app/gamecoupon/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-app/gamecoupon/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/blade-app/gamecoupon/submit',
    method: 'post',
    data: row
  })
}

export const grantCoupon = (da) => {
  return request({
    url: '/api/blade-app/gamecoupon/grantCoupon',
    method: 'post',
    data: da
  })
}


export const gamecouponPage = (current, size, params,startTime, endTime,usageStartTime,usageEndTime,releaseStartTime,releaseEndTime) => {
  return request({
    url: '/api/blade-app/gamecoupon/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,startTime, endTime,usageStartTime,usageEndTime,releaseStartTime,releaseEndTime
    }
  })
}
export const lssuerList = () => {
  return request({
    url: '/api/blade-app/gamecoupon/lssuerList',
    method: 'get'
  })
}
export const count = (params,startTime, endTime,usageStartTime,usageEndTime,releaseStartTime,releaseEndTime) => {
  return request({
    url: '/api/blade-app/gamecoupon/count',
    method: 'get',
    params: {
      ...params,
     startTime, endTime,usageStartTime,usageEndTime,releaseStartTime,releaseEndTime
    }
  })
}

export const removeCoupon = (id) => {
  return request({
    url: '/api/blade-app/gamecoupon/removeCoupon',
    method: 'post',
    params: {
      id,
    }
  })
}
export const oneClickDelete = () => {
  return request({
    url: '/api/blade-app/gamecoupon/oneClickDelete',
    method: 'get'
  })
}


export const gamecouponTmpPage = (current, size, params) => {
  return request({
    url: '/api/blade-app/gamecoupon/gamecouponTmpPage',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

export const saveCouponTmp = (row) => {
  return request({
    url: '/api/blade-app/gamecoupon/saveCouponTmp',
    method: 'post',
    data: row
  })
}

export const detaiTmplList = (BladeRecord) => {
  return request({
    url: '/api/blade-app/gamecoupon/detaiTmplList',
    method: 'get',
    params: {
      ...BladeRecord
    }
  })
}

export const removeGct = (actId) => {
  return request({
    url: '/api/blade-app/gamecoupon/removeGct',
    method: 'post',
    params: {
      actId,
    }
  })
}
